<?php
/**
 * 文件下载
 * 
 * */


	class DownloadAction extends Action{	//下载页面的首页默认显示的本科生下载
		
		public function index(){
			import("ORG.Util.Page");
			$DownLoadFiles = new Model("Downloadfiles");
			
			$type = (int)$_GET['type'];
			
			if($type == 1){
				$downloadType = '本科生下载';
				$count = $DownLoadFiles->where('type=1')->count();
				$Page = new Page($count, 15);
	    		$show = $Page->show();
				$downloadFiles = $DownLoadFiles->where('type=1')->order('file_id desc')->limit($Page->firstRow.','.$Page->listRows)->select();	//本科生文件
			}

			else{
				$downloadType = '研究生下载';
				$count = $DownLoadFiles->where('type=0')->count();
				$Page = new Page($count, 15);
	    		$show = $Page->show();
	    		
	    		$downloadFiles = $DownLoadFiles->where('type=0')->order('file_id desc')->limit($Page->firstRow.','.$Page->listRows)->select();	//研究生文件
			
			}
				
			$this->assign("downloadType",$downloadType);
			$this->assign("downloadFiles",$downloadFiles);
			$this->assign('page',$show); 
			$this->display();
		}
		
		
			
	}
	
	

	
?>